package me.ereach.basics;

import org.junit.Test;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;

public class MyTest {
    @Test
    public void test04() throws IOException {
        InputStream f = new FileInputStream("/Users/jinzhengdong/readme.txt");
        int x = 0;
        while (x == -1) {
            x = f.read();

            if (x == -1)
                break;
            else
                System.out.println((char) x);
        }

        System.out.println("ok");
    }

    @Test
    public void test03() {
        Collection<String> lst = new ArrayList<>();

        lst.add("Hello");
        lst.add("Are");
        lst.add("you");
        lst.add("OK");

        System.out.println(lst);
    }

    @Test
    public void test02() {
        Shape shape_ = new Circle();
        Circle circle_ = new Circle();

        System.out.println(circle_ instanceof Shape);
//        System.out.println(Circle instanceof  Shape);
        System.out.println(shape_ instanceof Circle);

    }

    @Test
    public void test01() {
        int[] list = {11, 21, 31, 41};
        System.out.println(list[2]);
    }

    @Test
    public void testCast() {
        int a = 10;
        byte b = (byte) a;
    }
}
